using System.Data;
using ET;
namespace DAL
{
    public class Bank_Account_DAL
    {
        private readonly clsConnect cls = new clsConnect();

        #region Getdata
        public DataTable BindGirdtb_Bank_Account(string keywords)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@KeyWords", keywords);
            return cls.GetData("sp_tb_Bank_Account_Search");
        }
        public DataTable BindGirdtb_Bank_AccountDetail(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Bank_Account_ID", id);
            return cls.GetData("sp_tb_Bank_Account_Detail");
        }
        #endregion

        #region Insert
        public bool Inserttb_Bank_Account(Bank_Account_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Bank_Account_Name", data.Bank_Account_Name);
            cls.AddParameter("@Bank_Name", data.Bank_Name);
            cls.AddParameter("@Bank_Account_Note", data.Bank_Account_Note);
            cls.AddParameter("@Bank_Account_User_Add", data.Bank_Account_User_Add);
            cls.AddParameter("@Bank_Account_Date_Add", data.Bank_Account_Date_Add);
            cls.AddParameter("@Bank_Account_Computer_Add", data.Bank_Account_Computer_Add);
            return cls.ExecuteNonQuery("sp_tb_Bank_Account_Insert");
        }
        #endregion

        #region Update
        public bool Updatetb_Bank_Account(Bank_Account_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Bank_Account_ID", data.Bank_Account_ID);
            cls.AddParameter("@Bank_Account_Name", data.Bank_Account_Name);
            cls.AddParameter("@Bank_Name", data.Bank_Name);
            cls.AddParameter("@Bank_Account_Note", data.Bank_Account_Note);
            cls.AddParameter("@Bank_Account_User_Modify", data.Bank_Account_User_Modify);
            cls.AddParameter("@Bank_Account_Date_Modify", data.Bank_Account_Date_Modify);
            cls.AddParameter("@Bank_Account_Computer_Modify", data.Bank_Account_Computer_Modify);
            return cls.ExecuteNonQuery("sp_tb_Bank_Account_Update");
        }
        #endregion

        #region Delete
        public bool Deletetb_Bank_Account(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter( "@Bank_Account_ID", id);
            return cls.ExecuteNonQuery("sp_tb_Bank_Account_Delete");
        }
        #endregion
    }
}